<%@ page import="entity.User" %>
<%@ page import="org.omg.PortableInterceptor.USER_EXCEPTION" %>
<%@ page import="java.util.List" %>
<%@ page import="entity.Message" %>
<%@ page import="javax.print.DocFlavor" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" charset="UTF-8"/>
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
    <link rel="stylesheet" href="css/index.css">
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript" event="onload">

        function onchangeFunction() {
            $.get("/FinalWork/showPhotoAjax", {"uFace":$("#change_img").val()}, function (data, status) {
                console.log($("#change_img").val())
                $("#preview_div").html(data);
            })
        }
    </script>

</head>
<body>
<%
    User user = (User) session.getAttribute("user");
    System.out.println("当前用户的头像为:"+user.getImg_path());
%>
<div class="righter" style="border: white 5px solid">
    <a href="#" name="info"></a>
    <!--            个人信息-->
    <div class="personal-info">
        <div class="info">
            <span class="title">账号信息</span>
            <div class="line"></div>
<%--            <div class="modify_bt" ><a style="color: #108ee9;">修改信息</a></div>--%>
            <div class="contain">
                <div class="item">
                    <div class="item_key">ID</div>
                    <div class="item_val" ><%=user.getId()%></div>
                </div>
                <div class="item">
                    <div class="item_key">用户名</div>
                    <div class="item_val"><%=user.getName()%></div>
                </div>
                <div class="item">
                    <div class="item_key">手机号</div>
                    <div class="item_val"><%=user.getPhone()%></div>
                </div>
                <div class="item">
                    <div class="item_key">姓名</div>
                    <%
                        String name =user.getReal_name();
                        if (name ==null){
                            name="未填写";
                        }%>
                    <div class="item_val"><%=name%></div>
                </div>
                <div class="item">
                    <div class="item_key">性别</div>
                    <%
                        String sex;
                        if (user.getSex()==true){
                            sex = "男";
                        }else if(user.getSex()==false){
                            sex="女";
                        }else{
                            sex="未填写";
                        }
                    %>
                    <div class="item_val"><%=sex%></div>
                </div>
                <div class="item">
                    <div class="item_key">Email</div>
                    <%
                        String email = user.getEmail();
                        if (email==null || email.equals("")){
                            email="未填写";
                        }
                    %>
                    <div class="item_val"><%=email%></div>
                </div>
            </div>
        </div>
        <div class="info">
            <span class="title">学历简介</span>
            <div class="line"></div>
<%--            <div class="modify_bt">修改信息</div>--%>
            <div class="contain">
                <div class="item">
                    <div class="item_key">学校</div>

                    <%
                        String school =user.getSchool();
                        if (school ==null){
                            school="未填写";
                        }%>
                    <div class="item_val"><%=school%></div>
                </div>
                <div class="item">
                    <div class="item_key">年级</div>

                    <%
                        String grade =user.getGrade();
                        if (grade ==null){
                            grade="未填写";
                        }%>
                    <div class="item_val"><%=grade%></div>
                </div>
            </div>
        </div>
        <div class="info">
            <span class="title">我的头像</span>
            <div class="line"></div>
            <div class="container" style="width: 70px;height: 70px;border: black 1px solid;margin-left: 30px;margin-top: 15px">
                <img src="img/head/<%=user.getImg_path()%>" alt="" id="img_cvs" style="width: 100%;height: 100%;">
<%--                <canvas id="cvs" width="200" height="200"></canvas>--%>
<%--                <span class="btn upload">上传头像<input type="file" class="upload_pic" id="upload" /></span>--%>
            </div>
        </div>
    </div>
</div>


</body>
</html>